package org.yihang.entity;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class Condition {

	private int page = 1;

	private int pageSize = 10;

	private Map<String, Object> param = new HashMap<>();

	public int getOffset() {
		return (page - 1) * pageSize;
	}

	public int getLimit() {
		return pageSize;
	}

	public Condition(int page, int pageSize) {
		super();
		this.page = page;
		this.pageSize = pageSize;
	}

	public Condition() {
	}

	public Condition put(String key, Object value) {
		this.param.put(key, value);
		return this;
	}

}
